home *** CD-ROM | disk | FTP | other *** search
- // file name
- //
- // © 1996 Now Software, Inc
- // written by: hac
-
- #include "Main.h"
-
- pascal void main(PlugInInformation *plugInInformation)
- {
- plugInInformation->version = kPlugInInformationVersionOne;
- plugInInformation->plugInType = kTimePlugInType;
- plugInInformation->PrepareMenu = &PrepareMenu;
- plugInInformation->HandleMenuItemSelected = &HandleMenuItemSelected;
- }
-
- pascal void PrepareMenu(InstantAccessInformation *information, short asPreview)
- {
- Str255 time;
- Str255 date;
- MenuItemInformation menuItem;
- DateTimeRec dtrp;
- unsigned long secs;
-
- GetDateTime(&secs);
-
- IUDateString(secs, abbrevDate, date);
- IUTimeString(secs, 0, time);
-
- // add some spacing
- BlockMove(", ", &date[date[0] + 1], 2);
- date[0] += 2;
-
- // add time
- BlockMove(&time[1], &date[date[0] + 1], time[0]);
- date[0] += time[0];
-
- BlockMove(date, menuItem.text, kMenuItemTextSize);
-
- // add a divider line above
- // add the clock menu item
- menuItem.version = kMenuItemInformationVersionOne;
- menuItem.classification = kMiscellaneousClassification;
- menuItem.type = kDividerMenuItemType;
- menuItem.id = 1;
- menuItem.enabled = false;
- menuItem.style = 0;
- menuItem.mark = 0;
- menuItem.hasSubMenu = FALSE;
- menuItem.subMenu = nil;
- menuItem.refCon = 0;
- menuItem.owningPlugInType = kTimePlugInType;
-
- (*information->AddMenuItem)(&menuItem);
-
- // add the clock menu item
- menuItem.type = kTextMenuItemType;
- menuItem.id = 2;
- menuItem.enabled = true;
-
- (*information->AddMenuItem)(&menuItem);
-
- // add a divider line below our time piece - kDividerMenuItemType
- menuItem.type = kDividerMenuItemType;
- menuItem.id = 2;
- menuItem.enabled = false;
-
- (*information->AddMenuItem)(&menuItem);
-
- error:;
-
- }
-
- pascal void CleanUpAfterMenuSelect(InstantAccessInformation *information, short asPreview)
- {
- //hmmmm....
- }
-
- pascal void HandleMenuItemSelected(InstantAccessInformation *information, MenuItemInformation *menuItem)
- {
-
- }
-